import { createRouter, createWebHashHistory } from 'vue-router'
// 公共结构
import Layout from '@/components/Layout.vue';

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      alias: '/',
      name: 'Login',
      component: () => import('@/views/Login.vue')
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('@/views/Register.vue')
    },
    {
      path: '/test',
      name: 'Test',
      component: () => import('@/views/Test.vue')
    },
    {
      path: '/admin',
      name: 'Admin',
      component: Layout,
      children: [
        {
          path: 'list',
          name:'Adminlist',
          component: () => import('@/views/Admin/List.vue'),
        },
        {
          path: 'role',
          name:'Role',
          component: () => import('@/views/Admin/Role.vue'),
        },
        {
          path: 'edit/:id',
          name:'Edit',
          component: () => import('@/views/Admin/Edit.vue'),
        },
        {
          path: 'menu',
          name:'Menu',
          component: () => import('@/views/Admin/Menu.vue'),
        },
      ]
    },
    {
      path: '/article',
      name: 'Article',
      component: Layout,
      children: [
        {
          path: 'list',
          name:'List',
          component: () => import('@/views/Article/List.vue'),
        },
        {
          path: 'release',
          name:'Release',
          component: () => import('@/views/Article/Release.vue'),
        },
        {
          path: 'say',
          name:'Say',
          component: () => import('@/views/Article/Say.vue'),
        },
        {
          path: 'tag',
          name:'Tag',
          component: () => import('@/views/Article/Tag.vue'),
        },
        {
          path: 'edit/:id',
          name:'Edit',
          component: () => import('@/views/Article/Edit.vue'),
        },
     
      ]
    },
    {
      path: '/notice',
      name: 'Notice',
      component:Layout,
      children:[
        {
          path: 'list',
          name:'noticeList',
          component: () => import('@/views/Notice/List.vue'),
        },
        {
          path: 'public',
          name:'noticepublic',
          component: () => import('@/views/Notice/Public.vue'),
        },
        {
          path: 'edit/:id',
          name:'noticeedit',
          component: () => import('@/views/Notice/Edit.vue'),
        },
      ]
    },
    {
      path: '/extension',
      name: 'Extension',
      component:Layout,
      children:[
        {
          path: 'rotation',
          name:'Rotation',
          component: () => import('@/views/Extension/Rotation.vue'),
        },
        {
          path: 'link',
          name:'Link',
          component: () => import('@/views/Extension/Link.vue'),
        },
      ]
    },
    {
      path: '/user',
      name: 'User',
      component:Layout,
      children:[
        {
          path: 'list',
          name:'userList',
          component: () => import('@/views/User/List.vue'),
        },
      
      ]
    },
    {
      path: '/kindof',
      name: 'Kindof',
      component:Layout,
      children:[
        {
          path: 'kind',
          name:'kindlist',
          component: () => import('@/views/Kindof/Kind.vue'),
        },
      ]
    },


  ]
})

export default router
